package qunchen.com.mytestapplication.utils;

import java.io.Serializable;

/**
 * 一条数据
 */
public class ItemData  implements Serializable {


    public ItemData(String name) {
        this.name = name;
    }

    //蓝牙名字
    private  String name;
    //蓝牙地址
    private  String  mAddress;
    //剩余次数
    public   int restcount;


    public ItemData(String name, String mAddress) {
        this.name = name;
        this.mAddress = mAddress;
    }
    public ItemData(String name, String mAddress, int restcount) {
        this.name = name;
        this.mAddress = mAddress;
        this.restcount = restcount;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getmAddress() {
        return mAddress;
    }

    public void setmAddress(String mAddress) {
        this.mAddress = mAddress;
    }

    public int getRestcount() {
        return restcount;
    }

    public void setRestcount(int restcount) {
        this.restcount = restcount;
    }

    /**
     * 名字相等就是相等
     * @param obj
     * @return
     */
    @Override
    public boolean equals( Object obj) {
        if(obj == null){
            return false;
        }else {
            if(this.getClass() == obj.getClass()){
                ItemData u = (ItemData) obj;
                if(this.getName().equals(u.getName())){
                    return true;
                }else{
                    return false;
                }
            }else{
                return false;
            }
        }
    }

    /**
     * 输出名字
     * @return
     */
    @Override
    public String toString() {
        return name.toString();
    }
}
